﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class EventSystem : MonoBehaviour
{
    static EventSystem instance;

    [Header("战斗数据")]
    public GameObject hideObject;
    public Transform fightData;

    // Start is called before the first frame update
    void Awake()
    {
        if (instance != null)
            Destroy(this);
        instance = this;
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public static void StartFight(Team playerTeam,TeamData enemyTeamData)
    {
        FightData newFightData = Instantiate(instance.fightData).GetComponent<FightData>();
        newFightData.playerTeam = playerTeam;
        newFightData.enemyTeamData = enemyTeamData;
        SceneManager.LoadScene("FightScene", LoadSceneMode.Additive);
        instance.hideObject.SetActive(false);
    }
}
